<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
    function math (){
        let math = Math.ceil(Math.random()*10) 
        console.log(math);
        let i
        while(i!=math){
        i = prompt("输入")
        i==math?alert('对了'):i>math?alert('大了'):alert('小了')
        }
    }
    math()
    </script>
</body>
</html>